package cn.ad.server.persistence.dao;

import java.util.List;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import cn.ad.server.domain.ad.GeoCity;

@Component
public interface GeoCityDao {
	
	@Results(value = { @Result(column = "id", property = "id", id = true),
		@Result(column = "state_id", property = "stateId"),
		@Result(column = "default_flg", property = "defaultFlg"),
		@Result(column = "city_level", property = "cityLevel"),
		@Result(column = "is_major_city", property = "isMajorCity"),
		@Result(column = "update_time", property = "updateTime"),
		@Result(column = "full_name", property = "fullName"),
		@Result(column = "english_name", property = "englishName") })
	@Select("select * from geo_city where id = #{value}")
	public GeoCity findById(long id);
	@Results(value = { @Result(column = "id", property = "id", id = true),
			@Result(column = "state_id", property = "stateId"),
			@Result(column = "default_flg", property = "defaultFlg"),
			@Result(column = "city_level", property = "cityLevel"),
			@Result(column = "is_major_city", property = "isMajorCity"),
			@Result(column = "update_time", property = "updateTime"),
			@Result(column = "full_name", property = "fullName"),
			@Result(column = "english_name", property = "englishName") })
	@Select("select * from geo_city")
	public List<GeoCity> findAll();
	
}
